package week6;

import java.util.Scanner;

class Employee{
    private String name;
    private String gender;
    private int age;
    private String phone;
    public String getName(){
        return name;
    }
    public void setName(String name){
        this.name =name;
    }
    public String getGender(){
        return gender;
    }
    public void setGender(String gender){
    this.gender=gender;
    }
    public int getAge(){
        return age;
    }
    public void setAge(int age){
        this.age=age;
    }
    public String getPhone(){
        return phone;
    }
    public void setPhone(String phone){
        this.phone=phone;
    }
    public String getInfo(){
        return "姓名："+name+"，性别："+gender+"，年龄："+age+"，电话:"+phone;
    }
}
public class TestEmployee {
    public static void main(String[] args){
        Scanner scanner =new Scanner(System.in);
        Employee[] employees =new Employee[3];
        for (int i=0;i<employees.length;i++){
            Employee emp=new Employee();
            System.out.println("请输入第"+(i+1)+"个员工的姓名：");
            emp.setName(scanner.next());
            System.out.println("请输入性别：");
            emp.setGender(scanner.next());
            System.out.println("请输入年龄：");
            emp.setAge(scanner.nextInt());
            System.out.println("请输入电话：");
            emp.setPhone(scanner.next());
            employees[i]=emp;
        }
        System.out.println("员工信息列表：");
        for (Employee emp : employees){
            System.out.println(emp.getInfo());
        }
        scanner.close();
    }
}
